#ifndef MYSTATUSBAR_H
#define MYSTATUSBAR_H

#include <QFrame>
#include <QSize>
#include <QPaintEvent>
#include <QEvent>

class MyStatusBar : public QFrame
{
    Q_OBJECT
private:
	class MyStatusBarPrivate;
	MyStatusBarPrivate *d;
public:
	enum ConnectStatus{
		Disconnected,
		Connecting,
		Connected,
		Encrypted
	};

    explicit MyStatusBar(QWidget *parent = 0);

	//TODO
	//in future add resizer
//	void setSizeGripEnabled(bool);
//	bool isSizeGripEnabled() const;

	QSize sizeHint() const;

	QString currentMessage() const;


	void setConnectionStatusText(const QString &status);
	void setConnectionStatus(const ConnectStatus &status);

	QString getConnectionStatusText() const;
	ConnectStatus getConnectionStatus() const;

protected:
	void paintEvent(QPaintEvent *e);
	bool eventFilter(QObject *, QEvent *);
	bool event(QEvent *e);

public slots:
	void showMessage(const QString &text, int timeout = 0);
	void clearMessage();

signals:
	void clicked();
	void clickedRight();

};

#endif // MYSTATUSBAR_H
